#pragma once
#ifndef __G_PIXEL_H__
#define __G_PIXEL_H__

#include "GTypes.h"
#include "GTexture.h"

namespace GEngine
{
	// Base class for pixel access
	template<GTextureFormat Format>
	class GPixel
	{
	};

	template<>
	class GPixel <G_TF_UINT_R8>
	{
	public:
		GUInt8	Red;

		GPixel(GUInt8 R) : Red(R) {};
	};

	template<>
	class GPixel <G_TF_UINT_R16>
	{
	public:
		GUInt16	Red;

		GPixel(GUInt16 R) : Red(R) {};
	};

	template<>
	class GPixel <G_TF_UINT_R32>
	{
	public:
		GUInt32	Red;

		GPixel(GUInt32 R) : Red(R) {};
	};

	template<>
	class GPixel <G_TF_UINT_R8G8>
	{
	public:
		GUInt8	Red;
		GUInt8	Green;

		GPixel(GUInt8 R, GUInt8 G) : Red(R), Green(G) {};
	};

	template<>
	class GPixel <G_TF_UINT_R16G16>
	{
	public:
		GUInt16	Red;
		GUInt16	Green;

		GPixel(GUInt16 R, GUInt16 G) : Red(R), Green(G) {};
	};

	template<>
	class GPixel <G_TF_UINT_R32G32>
	{
	public:
		GUInt32	Red;
		GUInt32	Green;

		GPixel(GUInt32 R, GUInt32 G) : Red(R), Green(G) {};
	};

	template<>
	class GPixel <G_TF_UINT_R8G8B8A8>
	{
	public:
		GUInt8	Red;
		GUInt8	Green;
		GUInt8	Blue;
		GUInt8	Alpha;

		GPixel(GUInt8 R, GUInt8 G, GUInt8 B, GUInt8 A) : Red(R), Green(G), Blue(B), Alpha(A) {};
	};

	template<>
	class GPixel <G_TF_UINT_R16G16B16A16>
	{
	public:
		GUInt16	Red;
		GUInt16	Green;
		GUInt16	Blue;
		GUInt16	Alpha;

		GPixel(GUInt16 R, GUInt16 G, GUInt16 B, GUInt16 A) : Red(R), Green(G), Blue(B), Alpha(A) {};
	};

	template<>
	class GPixel <G_TF_UINT_R32G32B32A32>
	{
	public:
		GUInt32	Red;
		GUInt32	Green;
		GUInt32	Blue;
		GUInt32	Alpha;
	};

	template<>
	class GPixel <G_TF_FLOAT_R32>
	{
	public:
		float	Red;

		GPixel(float R) : Red(R) {};
	};

	template<>
	class GPixel <G_TF_FLOAT_R32G32>
	{
	public:
		float	Red;
		float	Green;

		GPixel(float R, float G) : Red(R), Green(G) {};
	};
	
	template<>
	class GPixel <G_TF_FLOAT_R32G32B32A32>
	{
	public:
		float	Red;
		float	Green;
		float	Blue;
		float	Alpha;

		GPixel(float R, float G, float B, float A) : Red(R), Green(G), Blue(B), Alpha(A) {};
	};

}

#endif